SpeedBar odd behavior

This forum is for general developer support questions.

SpeedBar odd behavior

Postby mritter0 » Tue Nov 10, 2015 3:14 am

I am using a speedbar.gadget in text only mode. All is fine until I add a button with text, or more accurately, with a pixel length longer than this text: 12345678901234567890. Doing WWWWWWWWW needs less than 20 of them, but similar length, so it is not a number of characters issue.

What it does is kick the width of the speedbar out by the same width, increasing the window width by same amount, and "locks" it from resizing the window back down to previous size. I close my program, restart, I still can't reduce the window width back down, the speedbar has it "locked" again.

As long as I don't add a button over that pixel count, everything works fine.
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 211
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: SpeedBar odd behavior

Postby broadblues » Tue Nov 10, 2015 2:41 pm

As every font is different 12345678901234567890 is bit vague for a size, can you measure the exact amount of pixels where you start to see the effect?

I don't see any problem in AWeb with long buttons. That's the only program I can test them with in text mode. Src is available to that if you want to see how it handles the speedbar (beware direct copying ofcourse due to it's licence).

Are you detaching and reattaching the node list between changes? Most list based gadgets need this unless they have a method for dynamic attachment.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 538
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: SpeedBar odd behavior

Postby mritter0 » Wed Nov 11, 2015 1:44 am

It takes about 165 pixels (the entire button width, not just the text). It will start with a small increase in gadget size, then the more pixels (letters) the bigger the increase.

List is detached and FreeSpeedBarList() before updating the list.

I can add as many buttons as I want that are under the 165 pixels and all is good.
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 211
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: SpeedBar odd behavior

Postby broadblues » Wed Nov 11, 2015 3:28 am

Do you rethink the window after modifying?
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 538
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: SpeedBar odd behavior

Postby mritter0 » Thu Nov 12, 2015 12:00 am

Yes
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 211
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA


Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 6 guests